package com.uphone.kingmall.activity.personal;


import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.lzy.okgo.model.HttpParams;
import com.uphone.kingmall.adapter.UserRecodAdapter;
import com.uphone.kingmall.adapter.YongJinListAdapter;
import com.uphone.kingmall.base.BaseListActivity;
import com.uphone.kingmall.bean.WalletRecoedBean;
import com.uphone.kingmall.utils.HttpParamsUtils;
import com.uphone.kingmall.utils.MyUrl;
import com.uphone.kingmall.utils.intent.IntentData;

/**
 * <pre>
 *     author : radish
 *     e-mail : 15703379121@163.com
 *     time   : 2019/3/22
 *     desc   :
 * </pre>
 */
public class YongJinListActivity extends BaseListActivity<WalletRecoedBean, WalletRecoedBean.DataBean> {

    public static final int TYPE_ORDER = 0X0011;// 交易记录
    public static final int TYPE_WALLET = 0X0022;// 佣金明细
    @IntentData
    private int type = TYPE_ORDER;

    @Override
    protected String initTitle() {
        if (type == TYPE_WALLET) {
            return "佣金明细";
        }
        return "交易记录";
    }

    @Override
    protected void itemClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    protected BaseQuickAdapter initAdapter() {
        if (type == TYPE_WALLET) {
            return new YongJinListAdapter();
        }
        return new UserRecodAdapter();
    }

    @Override
    protected WalletRecoedBean getBeans() {
        return new WalletRecoedBean();
    }

    @Override
    protected HttpParams getParams() {
        return HttpParamsUtils.getInstance().put("page", page).put("limit", 10).getParams();
    }

    @Override
    protected String getUrl() {
        if (type == TYPE_WALLET) {
            return MyUrl.getUserShareRecoed;
        }
        return MyUrl.getUserResumeRecoed;
    }
}
